﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DeviceEntity.Device.Printer.View
{
    /// <summary>
    /// PrinterDebugView.xaml 的交互逻辑
    /// </summary>
    public partial class PrinterDebugView : UserControl
    {
        /// <summary>
        /// 绑定对象
        /// </summary>
        private ViewModel.PrinterDebugViewModel viewModel = new ViewModel.PrinterDebugViewModel();
        /// <summary>
        /// 配置参数
        /// </summary>
        private DeviceEntity.Model.DeviceConfigModel _deviceConfig = null;
        /// <summary>
        /// 刻印机调试页面
        /// </summary>
        /// <param name="deviceConfig">配置参数</param>
        public PrinterDebugView(DeviceEntity.Model.DeviceConfigModel deviceConfig)
        {
            InitializeComponent();
            DataContext = viewModel;
            _deviceConfig = deviceConfig;
            //绑定到界面可做显示
            viewModel.DeviceName = deviceConfig.name;
            viewModel.DeviceType = deviceConfig.type.ToDescription();
            viewModel.DeviceConfig = $"{deviceConfig.mode}-{deviceConfig.port}";
        }
    }
}
